package com.zeta.eduservice.mapper;

import com.zeta.eduservice.entity.EduClasss;

import com.zeta.eduservice.entity.EduTeacher;
import com.zeta.eduservice.entity.question.EduCourse;
import com.zeta.eduservice.entity.question.EduCourseClass;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * <p>
 * 课程 班级中间表 Mapper 接口
 * </p>
 *
 * @author zeta
 * @since 2021-03-29
 */
public interface EduCourseClassMapper extends BaseMapper<EduCourseClass> {
	@Select("select a.id,d.`name`,c.`name`,a.title,a.buy_count,a.version from edu_course a join edu_course_class b on a.id=b.course_id join edu_academy c on c.id=a.academy_id join edu_teacher d on d.id=a.teacher_id where b.class_id=#{classiId} and a.is_deleted=0 and b.is_deleted=0 and c.is_deleted=0 and d.is_deleted=0 ")
	List<EduCourse> getCourseListByClassId(Page<EduCourse> pageParam,@Param("classiId") String classiId);
	
	@Select("select a.id,c.`name`,d.`name`,a.`name` from edu_classs a join edu_course_class b on a.id=b.class_id join edu_academy c on c.id=a.academy_id  join edu_major d on a.major_id = d.id where b.course_id=#{courseId} and a.is_deleted=0 and b.is_deleted=0 and c.is_deleted=0 and d.is_deleted=0 ")
	List<EduClasss> getClassListByCourseId(Page<EduClasss> pageParam,@Param("courseId") String courseId);

	
	
}

